<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Person details</title>
  </head>

  <body>
    <div class="nav">
      <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
      <span class="menuButton"><g:link class="list" action="list">Person List</g:link></span>
      <span class="menuButton"><g:link class="create" action="create">New Person</g:link></span>
      <span class="menuButton">
	<g:link class="vacations" action="vacationList" id="${fieldValue(bean:personInstance,field:'id')}">
	  ${personInstance.name} ${personInstance.lastName} vacations
	</g:link>
      </span>
      <span class="menuButton">
	<g:link class="teams" action="teamList" id="${fieldValue(bean:personInstance,field:'id')}">
	  ${personInstance.name} ${personInstance.lastName} teams
	</g:link>
      </span>
    </div>

    <div class="body">
      <h1>${personInstance.name} ${personInstance.lastName}</h1>

      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>

      <div class="dialog">
        <table>
          <tbody>            
            <tr class="prop">
              <td valign="top" class="name">Id:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'id')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Name:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'name')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Last Name:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'lastName')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Telephone:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'telephone')}</td>              
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Email:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'email')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Birthday:</td>
              <td valign="top" class="value">
		<g:format date="${personInstance.birthday}" />
	      </td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Personal ID Number:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'personalIdNumber')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Nip:</td>
	      <td valign="top" class="value">${fieldValue(bean:personInstance, field:'nip')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Account Number:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'accountNumber')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">CV:</td>
              <td valign="top" class="value">
		<a href="${g.createLink(controller: 'person', action: 'downloadCV', id: personInstance.id)}">
		  ${personInstance.getCVFileName()}
		</a>
	      </td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Country:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'country')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">City:</td>              
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'city')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Street Number:</td>              
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'streetNumber')}</td>
            </tr>
            
            <tr class="prop">
              <td valign="top" class="name">Postal Code:</td>
              <td valign="top" class="value">${fieldValue(bean:personInstance, field:'postalCode')}</td>
            </tr>
          </tbody>
        </table>
      </div>

      <div class="buttons">
        <g:form>
          <input type="hidden" name="id" value="${personInstance?.id}" />
          <span class="button">
	    <g:actionSubmit class="edit" value="Edit" />
	  </span>
          <span class="button">
	    <g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" />
	  </span>
        </g:form>
      </div>

    </div>
  </body>
</html>
